upstream flask {
    least_conn;
    server flask:5000;    
}

server {
    listen      443 ssl;
    server_name     flask;
    ssl_certificate         /root/ssl/cert.pem;
    ssl_certificate_key     /root/ssl/key.pem;

    resolver 127.0.0.11 valid=5s;

    location / {
        proxy_pass http://flaskapp:5000/;
        proxy_set_header Host "flask";
    }
}